using Unity.VisualScripting;
using GameFramework.DataNode;

namespace LS.UGFUnits
{
    [UnitSurtitle("Data Node Property")]
    [UnitShortTitle("Get")]
    public sealed class GetDataNodeProperty : DataNodeUnit
    {
        [DoNotSerialize]
        public ValueOutput Root { get; private set; }

        protected override void Definition()
        {
            base.Definition();
            Root = ValueOutput<IDataNode>(nameof(Root));
        }

        protected override ControlOutput In(Flow flow)
        {
            flow.SetValue(Root,Target?.Root ?? null);
            return base.In(flow);
        }
    }
}